// 引包
var mongoose = require("mongoose");
var db = require("./db");
var ObjectID = require("mongodb").ObjectID;

// 创建了一个 Schema 结构
var judgeSchema = new mongoose.Schema({
    judgeName: {type: String, require: true},  // 姓名
    judgeId: {type: String, unique: true},  // 编号
    password: {type: String, default: "judge"},  // 密码
    judgePhone: {type: String, require: true}  // 手机
});

// 创建了一个裁判模版（裁判类），类是基于 Schema 创建的
var judgeModel = db.model("Judge", judgeSchema);
// 向外暴露裁判类
module.exports = judgeModel;
